
<!DOCTYPE html>
<html class="no-js">
<head lang="en">

    <#include "../head_import.html" />

</head>
<body>
<#include "../include/top_nav.html">
    <div class="am-cf admin-main">

        <!-- sidebar start -->
        <#include "../adspace/left.html">
            <!-- sidebar end -->
            <!-- content start-->
            <div class="admin-content">
                <div class="am-cf am-padding">
                    <div class="am-fl am-cf"><@s.m "global.position"/>: <@s.m "advertise.function"/> - <@s.m "global.add"/></div>
                </div>
                <div class="am-g">
                    <div class="am-u-sm-12 am-u-sm-centered">
                        <form class="ropt">
                            <input type="submit" value="<@s.m "global.backToList"/>" onclick="this.form.action='list.do';"/>
                        </form>
                        <div class="clear"></div>
                    </div>
                </div>
                <div class="am-g">
                    <div class="am-u-sm-12 am-u-sm-centered">
                        <@p.form id="baseForm" action="o_save.do" labelWidth="12">
                        <@p.text colspan="1" width="50" label="advertise.name" name="name" required="true" class="required" maxlength="100"/>
                        <@p.select colspan="1" width="50" label="adspace.name" name="adspaceId" list=adspaceList listKey="id" listValue="name" required="true"/><@p.tr/>
                        <@p.td colspan="2" label="advertise.txt" required="true">
                        <div id="attr_image">
                            <p class="attr"><@s.m "global.imageUrl"/>: <input type="text" id="uploadImgPath1" name="attr_image_url" class="required" maxlength="255" style="width:300px;"/></p>
                            <p class="attr"><@s.m "global.imageUpload"/>: <span id="ufc1"><input type="file" id="uploadFile1"/></span> <input type="button" value="<@s.m "imageupload.upload"/>" onclick="upload(1);"/><input type="hidden" id="mark1" value="false"/></p>
                            <p class="attr"><@s.m "global.imageSize"/>: <input type="text" name="attr_image_width" maxlength="50" style="width:70px;"/> * <input type="text" name="attr_image_height" maxlength="50" style="width:70px;"/> <span class="pn-fhelp"><@s.m "global.widthHeight"/></span></p>
                            <p class="attr"><@s.m "global.linkUrl"/>: <input type="text" name="attr_image_link" value="http://" maxlength="255" style="width:300px;"/></p>
                            <p class="attr"><@s.m "global.linkTitle"/>: <input type="text" name="attr_image_title" maxlength="255" style="width:300px;"/></p>
                            <p class="attr"><@s.m "global.linkTarget"/>: <@p.radio name="attr_image_target" value="_blank" list={"_blank":"global.blank","_self":"global.blank"}/></p>
                        </div>
                    </@p.td><@p.tr/>
                    <@p.text colspan="1" width="50" label="global.startTime" name="startTime" style="width:120px" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" />
                    <@p.text colspan="1" width="50" label="global.endTime" name="endTime" style="width:120px" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" /><@p.tr/>
                    <@p.text colspan="1" width="50" label="global.clickCount" name="clickCount" value="0" required="true" class="required digits" style="width:70px"/>
                    <@p.text colspan="1" width="50" label="global.displayCount" name="displayCount" value="0" required="true" class="required digits" style="width:70px"/><@p.tr/>
                    <@p.text colspan="1" width="50" label="advertise.weight" name="weight" value="1" required="true" class="required digits" style="width:70px"/>
                    <@p.radio colspan="1" width="50" label="global.enabled" name="enabled" value="true" list={"true":"global.true","false":"global.false"} required="true"/><@p.tr/>
                    <@p.td colspan="2"><@p.submit code="global.submit"/> &nbsp; <@p.reset code="global.reset"/></@p.td>
            </@p.form>
    </div>
    </div>



    </div>

    </div>


<script type="text/javascript">
$(function() {
	//attrChange("image");
	//$("#textColor").colorPicker();
	$("#baseForm").validate();
});
var attr_all=["image","flash","text","code"];
function attrChange(value) {
	for(var attr in attr_all) {
		if(attr_all[attr]==value) {
			showAttr(attr_all[attr]);
		} else {
			hideAttr(attr_all[attr]);
		}
	}
}
function hideAttr(value) {
	var name = "#attr_"+value;
	$(name).hide();
	$(name+" input,"+name+" select,"+name+" textarea").each(function() {
		$(this).attr("disabled","disabled");
	});
}
function showAttr(value) {
	var name = "#attr_"+value;
	$("#attr_"+value).show();
	$(name+" input,"+name+" select,"+name+" textarea").each(function() {
		$(this).removeAttr("disabled");
	});
}
</script>

<#include "/common/image_upload.html"/>
</body>
</html>